<?php

class dbaCreditCard {

  function dbaCreditCard (&$dba) {
    $this->dba = &$dba;
  }

  function add ($name,$activated){
    if (!$activated) $activated = 'N';
    return $this->dba->query("insert into ".$this->dba->tableforwarder."_shopCredCard (name,activated) values ('$name','$activated');");
  }

  function getall (){
    $this->dba->query("select * from ".$this->dba->tableforwarder."_shopCredCard;");
    return $this->dba->fetch_rows_Array();
  }

  function getactivated (){
    $this->dba->query("select id,name from ".$this->dba->tableforwarder."_shopCredCard where activated = 'Y';");
    return $this->dba->fetch_rows_Array();
  }

  function get ($id){
    $this->dba->query("select * from ".$this->dba->tableforwarder."_shopCredCard where id = '$id';");
    return $this->dba->fetch_row_Array();
  }

  function update ($id,$name,$activated) {
    if (!$activated) $activated = 'N';
    return $this->dba->query("update ".$this->dba->tableforwarder."_shopCredCard set name='$name',activated='$activated' where id ='$id';");
  }

  function del ($id) {
    return $this->dba->query("delete from ".$this->dba->tableforwarder."_shopCredCard where id = '$id';");
  }

}

?>